<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <title></title>
    <%--<script src="http://www.jq22.com/jquery/jquery-1.10.2.js" async></script>--%>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

    <link rel="stylesheet" href="${path}/plugins/bootstrap/css/bootstrap.css" type="text/css">
    <link rel="stylesheet" href="${path}/css/AttractionCss/animate.css" type="text/css">
    <link rel="stylesheet" href="${path}/css/AttractionCss/font-awesome.css" type="text/css">


    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>


</head>

<body>


<div class="container-fluid">
    <div class="row">
        <div class="container"
             style="background-color: #F7F9F7;padding-top: 50px;padding-bottom: 50px;margin-top: 50px;margin-bottom:50px;width: 800px">
            <div class="col-md-6 col-md-offset-3">
                <%--<form  class=""  >--%>
                    <input type="hidden" value="${userTable.id}" id="userId">
                <div id="addCommodityIndex" style="margin: 20px">
                    <!--input-group start-->
                    <div class="input-group row">
                        <div class="col-sm-3" style="width: 20px">
                            <label>上传身份证</label>
                        </div>
                        <div class="col-md-4 image">
                            <form method="post" enctype="multipart/form-data" id="imgform3">
                                <input type="file" name="myfile3" id="myfile3">
                            </form>
                            <!-- 图片放置位置 -->
                            <div id="preview3" style="width:  100px;height:100px;border:2px solid white">

                            </div>

                        </div>

                        <!--<input id="uploaderInput" class="uploader__input" style="display: none;" type="file" accept="" multiple="">-->
                    </div>
                    <span id="yanzheng">${errorMaps.yanzheng}</span>
                    <input style="display:none" value="false" id="yanzhengFlag"/>
                </div>
            </div>


            <div class="form-group" style="margin-bottom: 20px">
                <input class="form-control btn btn-primary" id="submit"
                       value="立&nbsp;&nbsp;即&nbsp;&nbsp;注&nbsp;&nbsp;册" onclick="insertm()">
            </div>

            <div class="form-group" style="margin-bottom: 20px">
                <input value="重置" id="reset" class="form-control btn btn-danger" type="reset">
            </div>
            <%--</form>--%>
        </div>
    </div>
</div>
</div>


<div class="container-fluid">
    <div class="row">
        <nav class="navbar navbar-inverse fixed-bottom" role="navigation">
            <div class="container-fluid" style="font-size: 13px">
                <div class="row">
                    <ul class="nav navbar-nav">
                        <li>
                            <div style="color: rgb(177, 177, 177);margin-top: 50px;margin-left: 150px">
                                <h4>悠&nbsp;U旅行</h4>
                                <p>悠&nbsp;U是一个新方式的<span style="color: bisque"> "旅行交友"</span> 的网站,<br>
                                    旨在帮助旅行者计划和结伴游玩,<br>
                                    可以提供业余的引路人带给旅行者更好的 <span style="color: bisque"> "游玩体验"</span><br>
                                    提供一定的旅行日记,打造 <span style="color: bisque">"新方式旅行交友"</span><br>
                                </p>
                            </div>
                        </li>
                        <li>
                            <div style="color: rgb(177, 177, 177);margin-top: 50px;margin-left: 180px">
                                <h4 style="text-align: center">关于我们</h4>
                                <ul class="nav navbar-nav" style="list-style: none;margin-left: 0px">
                                    <li>关于悠 U</li>
                                    <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;联系我们</li>
                                    <br>
                                    <li>服务协议</li>
                                    <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;游记协议</li>
                                    <br>
                                    <li>达人协议</li>
                                    <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;隐私政策</li>
                                    <br>
                                    <li>网络信息侵权通知指引</li>
                                    <br>
                                    <li>网站地图</li>
                                    <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;商业合作</li>
                                    <br>
                                    <li style="color: bisque">&nbsp;&nbsp;&nbsp;加入我们</li>

                                </ul>
                            </div>
                        </li>
                        <li>
                            <div style="color: rgb(177, 177, 177);margin-top: 50px;margin-left: 180px">
                                <h4 style="text-align: center">帮助中心</h4>
                                <ul class="nav navbar-nav" style="list-style: none;margin-left: 0px">
                                    <li>新手上路</li>
                                    <br>
                                    <li style="color: bisque">意见反馈</li>
                                    <li>&nbsp;&nbsp;&nbsp;&nbsp;常见问题</li>
                                    <br>
                                    <li style="color: bisque">帮助中心</li>
                                    <li>&nbsp;&nbsp;&nbsp;&nbsp;旅行工具</li>
                                    <br>
                                </ul>
                            </div>
                        </li>
                    </ul>
                </div>
                <br><br>
                <hr>
                <div style="color: rgb(177, 177, 177);margin-top: 20px;margin-left: 150px;font-size: 12px">
                    <div style="float: left;"><img src="http://pzgv309jp.bkt.clouddn.com/1fa25c33-124f-44fd-887f-a889d08c2120.jpg" width="60px" height="40px"
                                                   style="opacity: 0.7;border-radius: 80px;">
                    </div>
                    <div style="float: left;margin: 10px 5px;font-family: '楷体';font-size:18px">悠 U</div>
                    <div style="float: left;;margin-top: 10px;margin-left: 30px">© 2019 悠U
                        版权所有&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;经营许可&nbsp;&nbsp;&nbsp;营业执照
                    </div>
                    <div style="clear: both;margin-left: 130px;margin-bottom: 100px">
                        悠U不是旅行社,也不是代理商,我们只提供一些免费、客观、公正
                        、计费的攻略指南,以及一些业余的引路人
                        对外部网站概不负责
                    </div>

                </div>
            </div>
            <div
                    style="float: right;width: 40px;height: 50px;margin-right: 10px;background-color: aliceblue;text-align: center">
                <a href="#top" style="color: rgb(177, 177, 177)"><br>Top&nbsp;↑</a>
            </div>
        </nav>

    </div>
</div>


<%--<script src="${path}/plugins/jquery/jquery.min.js"></script>--%>
<!--引入bootstrap的js文件-->
<script src="${path}/plugins/bootstrap/js/bootstrap.js"></script>

<%--七牛云--%>

<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
<script src=" https://cdn.bootcss.com/jquery.form/4.2.2/jquery.form.js"></script>
<script type="text/javascript" src="${path}/js/edit/ajaxfileupload.js"></script>

<script>


    function insertm() {






        var yanzhengFlag=  document.getElementById("yanzhengFlag").value;




        if ( null != yanzhengFlag && yanzhengFlag.length > 0 && yanzhengFlag == 'true') {

            $.post('${path}/insertGuide', {phone: phone, address: address, profile: profile,photo:photo});

        }
    }



    $('#myfile3').change(function () {
        $("#imgform3").ajaxSubmit({
            url: "${path}/addUser1",
            method: 'POST',
            datType: 'json',

            success: function (data) {

                console.log(data.imgUrl);

                console.log(data.path);
                var ele = "<img src='/uyou' style='max-width: 100px;max-height: 100px'/>"
                $("#preview3").append(ele);//编程一个jquery的对象
                $("#preview3").find("img").attr("src", data.imgUrl);//调用jquery的方法找到
//                        图片的标签的名称，再设置里面的src的属性的值
                var userId = document.getElementById("userId").value;
                alert(userId)
                $.post('${path}/verified1', {paths: data.path, userId: userId}, function (data) {
                    if (data.flag == false) {
                        console.log(data.message)

                        $("#yanzheng").html("图片格式错误或该用户已经实名认证,请重新上传");
                        document.getElementById("yanzhengFlag").value = 'false';

                    } else {
                        console.log(data.message)
                        console.log(data.flag)
                        $("#yanzheng").html("");
                        document.getElementById("yanzhengFlag").value = 'true';
                        console.log(data.flag)


                    }
                });
            },
            error: function (data) {
                alert(data);
            }
        })
    })


</script>


</body>

</html>